Skip to content

Conversation

wakingrufus
Copy link
Contributor

@wakingrufus wakingrufus commented Oct 16, 2025

fix ConfigurationClassParser so that @Imported BeanRegistrars use their own class name rather than the class they are imported to

This allows multiple BeanRegistrars to be imported from the same Configuration class

fixes #35652

@wakingrufus wakingrufus force-pushed the import-multiple-registrars branch from 8ae4bc1 to a9c0026 Compare October 16, 2025 21:29
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 16, 2025
@wakingrufus wakingrufus force-pushed the import-multiple-registrars branch from a9c0026 to 3e16de4 Compare October 16, 2025 21:44
…ir own class name rather than the class they are imported to

This allows multiple BeanRegistrars to be imported from the same Configuration class

fixes spring-projects#35652

Signed-off-by: wakingrufus <[email protected]>
@wakingrufus wakingrufus force-pushed the import-multiple-registrars branch from 3e16de4 to d7e950d Compare October 16, 2025 21:52
@wakingrufus wakingrufus marked this pull request as ready for review October 16, 2025 21:58
@sdeleuze sdeleuze added type: bug A general bug in: core Issues in core modules (aop, beans, core, context, expression) and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Oct 17, 2025
@sdeleuze sdeleuze added this to the 7.0.0-RC2 milestone Oct 17, 2025
@sdeleuze sdeleuze self-assigned this Oct 17, 2025
@sdeleuze sdeleuze changed the title fix @Import with multiple BeanRegistrars Fix @Import with multiple BeanRegistrars Oct 17, 2025
@sdeleuze sdeleuze changed the title Fix @Import with multiple BeanRegistrars Fix @Import with multiple bean registrars Oct 20, 2025
sdeleuze pushed a commit to sdeleuze/spring-framework that referenced this pull request Oct 20, 2025
This commit add a test for multiple bean registrars imported by the same
configuration class.

See spring-projectsgh-35653
Signed-off-by: wakingrufus <[email protected]>
@sdeleuze sdeleuze closed this in 5fd3c9c Oct 20, 2025
@sdeleuze
Copy link
Contributor

@wakingrufus I kept your test from the PR but fixed the bug in a different way, as we want to keep exposing the configuration class metadata, not the registrar one.

Thanks for catching this pretty serious bug before the GA!

@wakingrufus
Copy link
Contributor Author

@wakingrufus I kept your test from the PR but fixed the bug in a different way, as we want to keep exposing the configuration class metadata, not the registrar one.

Thanks for catching this pretty serious bug before the GA!

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@Import multiple BeanRegistrar does not work

3 participants